package com.jwgcs.runningDog.main;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.SceneBuilder;
import javafx.stage.Stage;

import java.util.ResourceBundle;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception{
//        InputStream is = new FileInputStream("D:\\develop\\WorkSpace\\idea001\\RunningPig\\out\\production\\RunningPig\\com\\jwgcs\\runningDog\\fxml\\runningDog.fxml");
//        Parent root = new FXMLLoader().load(is);
        try {
            Parent root = FXMLLoader.load(getClass().getResource("runningDog.fxml"),
                    ResourceBundle.getBundle("config"));

            primaryStage.setTitle("奔跑的小狗");
            primaryStage.setWidth(900);
            primaryStage.setHeight(500);
            primaryStage.setScene(
                    SceneBuilder.create()
                            .root(root)
                            .build()
            );
            primaryStage.show();


        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @Override
    public void stop() throws Exception {
        super.stop();
        System.out.println("谢谢使用奔跑的小狗");
        System.exit(0);
    }

    public static void main(String[] args) {
        launch(args);
    }
}
